Exercise 1

This first exercise will test your knowledge of aggregate functions.

We'll cover the following

Problem statement#

Write a SQL query to fetch the count of employees working on project ‘P1’.

Input#

The following tables are available to you as inputs:

Employee Table

Emp_Id Full_Name Joining_Date
100 John Smith 2019/02/20
101 Anthony Williams 2019/03/01
102 Ethan Carter 2019/01/28
103 Mathew Mercer 2019/04/15
104 Nolan North 2019/05/19
105 Ashley Jenkins 2019/09/20
106 Amy Madison 2019/07/05
107 Emily Simpson 2019/08/22
108 Betty White 2019/07/09

Salary Table

Emp_Id Project Salary
100 P1 20,000
101 P2 40,000
102 P3 50,000
103 P3 50,000
104 P2 40,000
105 P4 15,000
106 P1 20,000
107 P5 70,000
108 P5 55,000

Challenge#

Write your query in the widget below. You don’t need to worry about creating the tables as they have already been created for you. All you need to do is write the query mentioned in the problem statement.

If you feel stuck or think you have written the right query, the solution is discussed in the next lesson.

RIGHT JOIN
Solution to Exercise 1
Mark as Completed
Report an Issue